package com.example.sy_2;


import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class ShowInfomation extends GenericServlet {
    @Override
    public void service(ServletRequest request, ServletResponse response)
            throws ServletException, IOException {
        // 设置响应内容类型
        response.setContentType("text/html;charset=utf-8");
        // 获取响应的输出流
        PrintWriter out = response.getWriter();

        // 输出HTML内容
        out.println("<html><body>");
        out.println("<h1>个人信息</h1>");
        out.println("<p>专业: 计算机科学与技术</p>");
        out.println("<p>班级: 2024级</p>");
        out.println("<p>学号: 12345678</p>");
        out.println("<p>姓名: 张三</p>");
        out.println("<p>性别: 男</p>");
        out.println("<p>年龄: 20</p>");
        out.println("</body></html>");

        // 关闭输出流
        out.close();
    }
}


